package tile;

// -------------------------------------------------------------------------
/**
 *  Write a one-sentence summary of your class here.
 *  Follow it with additional details about its purpose, what abstraction
 *  it represents, and how to use it.
 *
 *  @author Henry
 *  @version Oct 4, 2013
 */
public abstract class Tile
{
    private int xPos;
    private int yPos;
    private String tileType;

    public Tile(final int x, final int y, String type) {
        xPos = x;
        yPos = y;
        tileType = type;
    }

    public int x() {
        return xPos;
    }

    public int y() {
        return yPos;
    }

    public String getTileType() {
        return tileType;
    }

    @Override
    public boolean equals(Object other) {
        if (other instanceof Tile) {
            Tile temp = (Tile)other;
            return this.x() == temp.x() && this.y() == temp.y() && this.getTileType().equals(temp.getTileType());
        }
        return false;
    }

    @Override
    public String toString() {
        return "(" + x() + ", " + y() + ") " + getTileType();
    }
}
